<!-- tab-bar我的界面 （首页）-->
<template>
	<view class="container">
		<view style="height: 100px;background-color: #007AFF;padding-top: 100px;background-image: url(../../../../static/header_icon.png);">
			<uni-card style="height: 80px;">
				<view style="display: flex;flex-direction: row;">
					<view style="width: 25%;">
						<view style="height: 55px;width:55px;background-image:url(../../../../static/logo.png);border-radius: 50%; margin-bottom: 10px;"></view>
					</view>
					<view style="margin-right: 20px;align-items: center;width: 30%;">
						<view style="line-height: 60px;">我的名字<br/>15923579512</view>

					</view>
					<view style="width: 30%;">
						<view style="line-height: 60px;">我的团队</view>
					</view>
					<view>
						<uni-icons type="arrowright" size="51"></uni-icons>
					</view>
					
					
				</view>
			</uni-card>
		</view>
		<uni-grid :column="3" :highlight="true" style="width: 100%;">
			<uni-grid-item class="grid-box" v-for="(item, index) in gridOptions" :index="index" :key="index">
				<view class="grid-item-box" @click="toPage(item.toPage)">
					<image :src="item.url" class="image" mode="aspectFill" style="width: 50px;height: 50px;" />
					<text class="text">{{ item.text }}</text>
				</view>
			</uni-grid-item>
		</uni-grid>
	</view>
</template>
	
<script>
	import request from "@/common/request.js";
	export default {
		data() {
			return {
				gridOptions:[{
						url: '/static/template.png',
						text: '终端管理',
						badge: '0',
						type: "primary",
						toPage: "../../terminal_manage/index"	//跳转到指定页面
					},{
						url: '/static/template.png',
						text: '标签管理',
						badge: '0',
						type: "primary",
						toPage: "../../label_manage/index"
					},{
						url: '/static/template.png',
						text: '分组管理',
						badge: '0',
						type: "primary",
						toPage: "../../group_manage/index",
					},{
						url: '/static/template.png',
						text: '系统配置',
						badge: '0',
						type: "primary",
						toPage: "../../system_settings/index"
					},{
						url: '/static/template.png',
						text: '关于众寻',
						badge: '0',
						type: "primary",
						toPage: "../../about_zhongxun/index"
					},{
						url: '/static/template.png',
						text: '操作手册',
						badge: '0',
						type: "primary",
						toPage: "../../label_manage/index"
					},
				],
				
				UserData:[]
			}
		},
		methods: {
			toMain(){
				uni.switchTab({
					url:'../functions/tool_bar/me/index'
				})
			},
			toPage(page){
				uni.navigateTo({
					url:page
				})
			},
			getData(){
				let opts = {
					url : '/business/getInfo',
					method : 'post'
				}
				console.log("加载用户信息");
				uni.showLoading({
					title : '加载中'
				});
				
				request.httpTokenRequest(opts).then(res => {
								uni.hideLoading();
								if (res.code == 200) {
									console.log(res);
									this.UserData = res.data.data;
								} else {
									console.log("请求失败");
								}
							});
			}
		}
	}
</script>

<style>
	.flex-item {
		height: 70;
		text-align: center;
		line-height: 70rpx;
	}
	.grid-item-box{
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 15px 0;
	}
</style>
